package com.hen.web.henweb.model.enumeration;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author 狠穿
 * @version 1.0.0
 * @date 2023/4/30
 * @function 文章显示状态枚举
 */
public enum ArticleStatusEnum {

    SHOW(0,"展示"),
    HIDDEN(-1,"不展示");

    @EnumValue
    private int value;

    @JsonValue
    private String label;

    ArticleStatusEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static ArticleStatusEnum parse(int value){
        for (ArticleStatusEnum articleStatusEnum : ArticleStatusEnum.values()) {
            if(articleStatusEnum.getValue() == value){
                return articleStatusEnum;
            }
        }
        return null;
    }
}

